﻿$(function(){
     
Date.prototype.format = function(format){ 
		var o = { 
		"M+" : this.getMonth()+1, //month 
		"d+" : this.getDate() //day
		} 

		if(/(y+)/.test(format)) { 
			format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 
		} 

		for(var k in o) { 
			if(new RegExp("("+ k +")").test(format)) { 
				format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length)); 
			} 
		} 
		return format; 
	}
        var getHashData = function(hash){
            if(!hash) return false;
            var data = {};

            var optArr = hash.split("&");
            var x = 0;
            for(var a in optArr){
                var s = optArr[a].split("=");
                data[s[0]] = s[1];
            }

            return data;
        };

		var tsweek = new Date();
		var today=tsweek.format("yyyy-MM-dd");//今天
        var myDate = new Date();
		var year = myDate.getFullYear();
		var month = myDate.getMonth()+1;
        month=month*1-1;
		if (month<10){
			month = "0"+month;
		}
        month=today.substr(0,4)+"-"+month+"-"+today.substr(8,2);
        $("#startDate").val(month);
        $("#endDate").val(today);

 });  

   
   
   
   